/**
 * Copyright (c) 2009 Moogene
 * All rights reserved
 *
 * This software is the confidential and proprietary information of Moogene.
 * You shall not disclose such Confidential Information and shall use it only
 * in accordance with the terms of the license agreement you entered into
 * with Moogene
 */

package com.moogene.android;

import android.content.Context;
import android.content.res.Resources;
import android.util.AttributeSet;
import android.view.SurfaceHolder;
import android.view.SurfaceView;

/**
 * @author Song, jiawei
 *
 */
public class MooView extends SurfaceView implements SurfaceHolder.Callback {
	public static Resources sResource;
	public static Context sContext;
	public static SurfaceHolder sSurfaceHolder;
	public static int sScreenWidth;
	public static int sScreenHeight;
	public static boolean sIsSurfaceViewCreated;

	public MooView(Context context, AttributeSet attrs) {
		super(context, attrs);

		sSurfaceHolder = getHolder();
		sSurfaceHolder.addCallback(this);

		sContext = context;
		sResource = context.getResources();
		setFocusable(true); // make sure we get key events
		setFocusableInTouchMode(true);
	}

	@Override
	public void surfaceChanged(SurfaceHolder holder, int format, int width,
			int height) {
		// Rect r = sSurfaceHolder.getSurfaceFrame();
		sScreenWidth = width;
		sScreenHeight = height;
	}

	@Override
	public void surfaceCreated(SurfaceHolder holder) {
		// TODO Auto-generated method stub
	}

	@Override
	public void surfaceDestroyed(SurfaceHolder holder) {
		// TODO Auto-generated method stub

	}

}
